<!DOCTYPE html>
<html lang="zh-cn">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Test</title>
</head>
<style>
  .box {
    background-color: pink;
  }

  .nav {
    width: 200px;
    height: 50px;
  }
</style>

<body>
  <div class="box">innerText</div>
  <ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
  </ul>
  <script>
    const box = document.querySelector('.box')
    // console.dir(box)
    box.innerHTML = '<strong>Hello</strong>'
    // box.className += ' nav'
    box.classList.add('nav')
  </script>
</body>

</html>